home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / drdobbs / 1987 / 11 / holub.exp < prev    next >
Text File  |  1987-10-08  |  2KB  |  42 lines

  1. 
  2. 
  3. #define _DAY_     "6-17-87"
  4. #define _TIME_24_ "13:11:41"
  5. #define _TIME_    "1:11 PM"
  6. #define _DATE_    "6-17-87 1:11 PM"
  7. 
  8. «MDUL»Example 1: A date.h file created by dateh
  9. «MDNM»
  10. 
  11. struct timeb
  12. {
  13.   time_t         time;     /* Time, like that returned from time().  */
  14.   unsigned short millitm;  /* fraction of a second, in milliseconds */
  15.   short          timezone; /* The difference moving westward, in    */
  16.                            /* minutes, between Greenwich Mean Time  */
  17.                            /* and the local time.                   */
  18.   short          dstflag;  /* Nonzero if daylight savings time is   */
  19.                            /* in effect.                            */
  20. };
  21. 
  22. «MDUL»Example 2: The «MDNM»timeb «MDUL»structure
  23. «MDNM»
  24. 
  25. struct tm
  26. {
  27.     int tm_hour;        /* hour                            */
  28.     int tm_min;         /* minute                          */
  29.     int tm_sec;         /* second                          */
  30.     int tm_isdst;       /* daylight savings time is active */
  31.     int tm_year;        /* year - 1900                     */
  32.     int tm_mon;         /* month; January == 0             */
  33.     int tm_mday;        /* day of the month                */
  34.     int tm_wday;        /* day of the week; Sunday == 0    */
  35.     int tm_yday;        /* number of elapsed days since    */
  36.                         /* January 1, January 1 == 0    */
  37. }
  38. 
  39. «MDUL»Example 3: A «MDNM»tm «MDUL»structure
  40. «MDNM»
  41. 
  42.